package main

import (
	"fmt"
	"testing"
)

func main() {
	array := make([]string, 1, 2)
	array = append(array, "ssssss")
	//array[0] = "ddd"
	//array = append(array,"b")
	//array = append(array,"c")
	array[1] = "dddccc"
	fmt.Println(array)
}

func Benchmark_Division(b *testing.B) {
	matrixLength := int(20000)
	matrixA := createMatrix(matrixLength)
	matrixB := createMatrix(matrixLength)

	for n := 0; n < b.N; n++ {
		for i := 0; i < matrixLength; i++ {
			for j := 0; j < matrixLength; j++ {
				matrixA[i][j] = matrixA[i][j] + matrixB[i][j]
			}
		}
	}
}

func createMatrix(matrixLength int) [][]int {
	b := make([][]int, matrixLength)
	return b
}

//func BenchmarkAdapter_GetReport(b *testing.B) {
//	a := &Adapter{
//		Server: "127.0.0.1:9094/tenant",
//	}
//	for i := 0; i < b.N; i++ {
//		b.ReportAllocs() // 这里可以直接调用 ReportAllocs 方法，就省去了再命令行中输入 -benchmem ，用于查看内存分配的大小和次数
//		_, _ = a.GetReport("devices", "appsinfo", "")
//	}
//}
